#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int numberOfSteps(int num) {
    int cnt = 0;
    while (num)
    {
        if (num % 2 == 0)
        {
            num /= 2;
            cnt++;
        }
        if (num % 2 == 1)
        {
            num -= 1;
            cnt++;
        }
    }
    return cnt;
}